<?php require_once '../util/verifyMenu.php';?>
<?php require_once '../util/header.php';?>
<body>
<div class="mycontent" align="center">
<img src="public/img/header.png" style="width: 1024px; margin: -6px;">
<?php require_once '../util/menu.php';?>

<h2>Register</h2>
<hr>
<form name="frm" action="../control/registerControl.php" method="post" onsubmit="return verifyRegister()">
<table id="regis" cellspacing="5" cellpadding="10">
<?php 
	$err = array();
	if(isset($_GET['user'])){
		$err[] = "Username";
	}
	if(isset($_GET['em'])){
		$err[] = "Email";
	}
	if(isset($_GET['idc'])){
		$err[] = "IdCard";
	}
	if(count($err) > 0){
		$str = join(" , ", $err);
		echo "<span class='label label-warning'>Warning</span><br>";
		echo "<div style='width:50%;' class='alert alert-error'>$str ข้อมูลซ้ำ !</div>";
	}
?>
<tr>
<td>ชื่อ</td>
<td><input type="text" name="name"></td>
</tr>
<tr>
<td>นามสกุล</td>
<td><input type="text" name="lastname"></td>
</tr>
<tr>
<td>หมายเลขบัตรประชาชน</td>
<td><input type="text" name="idcard" maxlength="13" onblur="verifyIdCard()">&nbsp;&nbsp;<span id="i_err"></span></td>
</tr>
<tr>
<td>Username</td>
<td><input type="text" name="username">&nbsp;&nbsp;</td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="password" ></td>
</tr>
<tr>
<td>Confirm Password</td>
<td><input type="password" name="repassword" onkeyup="verifyPassword()">&nbsp;&nbsp;<span id="p_err"></span></td>
</tr>
<tr>
<td>Email</td>
<td><input type="email" name="email"></td>
</tr>
</table>
<br>
<input type="checkbox" id="chk" style="margin-bottom: 5px;"> <b>ยืนยันข้อมูล</b><br><br>
<input type="submit" class="btn btn-primary" value="Register">
<input type="reset" class="btn" value="Reset">
</form>
<?php require_once '../util/footer.php';?>

</div>
</body>
